package com.hspedu.homework.homwork01;

public class HomeWork06 {


    public static void main(String[] args) {
        Person Tang = new Person("唐僧", new Horse());
       Tang.common();
       Tang.passriver();
    }
}
interface Vehicles{

     void work();
}
class Horse implements Vehicles{


    @Override
    public void work() {
        System.out.println("骑马");
    }
}
class Boat implements Vehicles{

    @Override
    public void work() {
        System.out.println("开船");
    }
}
 class VehiclesGC{//交通工厂类调用马和船

     public VehiclesGC() {
     }

     private static final Horse horse=new Horse();
    public static Horse gethorse(){
//
        return horse;
     }
    public static Boat getboat(){


        return new Boat();
    }
 }